FROM docker.io/python:3.5.9-buster
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV LANG zh_CN.UTF-8
RUN python -m pip install -U pip
RUN pip install wheel -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install scipy -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install numpy -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install pandas -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install jqdatasdk -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install Django -i https://mirrors.aliyun.com/pypi/simple/
RUN apt-get update
RUN apt-get update && apt-get install -y \
    iputils-ping \
    iproute2 \
    curl \
    gcc \
    make \
    gnupg2 \
    wget \
    && rm -rf /var/lib/apt/lists/* \
    && curl -L https://downloads.sourceforge.net/project/ta-lib/ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz | tar xvz

WORKDIR /ta-lib
# numpy needs to be installed before TA-Lib
RUN pip install 'numpy==1.16.2' \
  && ./configure --prefix=/usr \
  && make \
  && make install \
  && pip install 'TA-Lib==0.4.17'

RUN cd .. && rm -rf ta-lib/

RUN mkdir /temp
VOLUME /tmp